﻿@using Ed.Entity
@using Ed.Web.Helpers
@model  List<Dictionary<string, object>>
@{
    Layout = null;
}
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>雪绒花_月嫂管理首页</title>
    <link href="~/Themes/default/home/css/index.css" rel="stylesheet" type="text/css">
    <link href="/Themes/default/lib/artDialog/css/ui-dialog.css" rel="stylesheet" />
    <script src="~/Themes/default/lib/jquery/jquery-1.11.1.min.js" type="text/javascript"></script>
    <script src="/Themes/default/lib/artDialog/dist/dialog-plus-min.js" type="text/javascript"></script>
    <script src="/Themes/default/lib/function.js" type="text/javascript"></script>
</head>
<body>
    <script type="text/javascript">
        $(function () {
            var m;
            $(".main li").hover(function () {
                m = $(this).index();
                $(".main li img").eq(m).animate({ width: "110px", marginTop: "0px" }, 200).animate({ width: "100px", marginTop: "5px" }, 200);
            }, function () {
                m = $(this).index();
                $(".main li img").eq(m).animate({ width: "90px", marginTop: "10px" }, 0);
            });

            var len = $(".main ul li").length;
            //alert(len);
            var wid = 182 * len;
            $(".main ul").css("width", wid + "px");
        });

        $(function () {
            $(".current-nav").mouseenter(function () {
                $(this).fadeOut(100, function () { $(".sidebar").animate({ left: "0" }, 300); });
            });
            $(".sidebar").mouseleave(function () {
                $(this).animate({ left: "-140px" }, 300, function () { $(".current-nav").fadeIn(0); });
            });
            var n;
            $(".sidebar li").hover(function () {
                n = $(this).index();
                $(".sidebar li img").eq(n).animate({ width: "70px", paddingTop: "0px" }, 200).animate({ width: "60px", paddingTop: "5px" }, 200);
            }, function () {
                n = $(this).index();
                $(".sidebar li img").eq(n).animate({ width: "50px", paddingTop: "10px" }, 0);
            });
        });


        function show_add() {
            showTopWindow("pregnanterinfo_show_add", "/Yuesao/PregnanterInfo/Edit?actionType=Add", null, 800, 460, function () {
                var pregnanterinfo_form1 = $(top.window.frames["frm_pregnanterinfo_show_add"].document).find("#pregnanterinfo_form1");
                var pregnanterinfo_form2 = $(top.window.frames["frm_pregnanterinfo_show_add"].document).find("#pregnanterinfo_form2");
                var pregnanterinfo_form3 = $(top.window.frames["frm_pregnanterinfo_show_add"].document).find("#pregnanterinfo_form3");
                //console.log(pregnanterinfo_form1);
                var flag = top.window.document.getElementById("frm_pregnanterinfo_show_add").contentWindow.form_valid();
                if (!flag) {
                    return false;
                }
                var data = $(pregnanterinfo_form1).serialize();
                var data2 = $(pregnanterinfo_form2).serialize();
                var data3 = $(pregnanterinfo_form3).serialize();
                data += "&" + data2 + "&" + data3;
                $.ajax({
                    type: "POST",
                    cache: false,
                    url: "/api/PregnanterInfoApi/AddPregnanterInfo",
                    data: data,
                    dataType: "json",
                    beforeSend: function () {
                        showTopDialog("show_add_loding", "<div class='dialog_loading'>添加中，请稍后...</div>", "温馨提示", 400, 95);
                    },
                    complete: function () {
                        //d.close().remove();
                    },
                    success: function (result) {
                        top.dialog.list["show_add_loding"].close().remove();
                        //toLowerCase报错
                        //var status = result.Status.toLowerCase();
                        var status = result.Status;
                        if (status == true || status == "true" || status == "True") {
                            //刷新数据
                            show_list();
                            showTopMsg("月嫂添加成功！", "温馨提示", "Success");
                        } else {
                            showTopMsg("系统异常，月嫂添加失败！", "错误提示", "Error");
                        }
                    },
                    error: function () {
                        top.dialog.list["show_add_loding"].close().remove();
                        showTopMsg("网络连接错误！", "错误提示", "Error");
                    }
                });

            }, function () { });
            //必须有这个，阻止刷新
            return false;

        }
        function show_list() {
            showTopContentWindow("show_list", "/Yuesao/PregnanterInfo/List", "预定月嫂信息管理", 1000, 500);
        }
        function show_list_closed() {
            showTopContentWindow("show_list_closed", "/Yuesao/PregnanterInfo/Closed", "已关闭月嫂信息管理", 1000, 500);
        }
        function show_list_trash() {
            showTopContentWindow("show_list_trash", "/Yuesao/PregnanterInfo/Trash", "回收站月嫂信息管理", 1000, 500);
        }
    </script>
    <!--固定顶部部分 开始-->
    <div class="header clearfix">
        <a href="javascript:void(0);" class="current-nav" style="display: block;"><em class="menu-more-ico">
        </em><span id="g_mod_name">月嫂管理</span> </a>
        <div class="vh-avator-area">
            <div class="gl-lang-container">
                <div class="account-avator">
                    <div class="account-avator-bg">
                    </div>
                </div>
                <span class="account-name" id="g_username2">@Session[EdKeys.SESSION_USER_NAME]（<b>@Session[EdKeys.SESSION_ROLE_NAME]</b>）<a
                    href="/Account/Login/Logout/">安全退出</a></span>
            </div>
        </div>
    </div>
    <!--固定顶部部分 结束-->
    <!--主页主题部分 开始-->
    <div class="main">
        <div class="main-container">
            <ul>
                @if (Html.LoadModulePowers(@Model, "Yuesao_add"))
                {
                    <li onclick=" show_add(); ">
                        <img src="~/Themes/default/home/images/yuesao_01.png" /><span>新增月嫂</span></li>
                }
                @if (Html.LoadModulePowers(@Model, "Yuesao_list"))
                {
                    <li onclick=" show_list(); ">
                        <img src="~/Themes/default/home/images/yuesao_02.png" /><span>维护月嫂</span></li>
                }
                @if (Html.LoadModulePowers(@Model, "Yuesao_closed"))
                {
                    <li onclick=" show_list_closed(); ">
                        <img src="~/Themes/default/home/images/yuesao_03.png" /><span>已关闭月嫂</span></li>
                }
                @if (Html.LoadModulePowers(@Model, "Yuesao_trash"))
                {
                    <li onclick=" show_list_trash(); ">
                        <img src="~/Themes/default/home/images/yuesao_04.png" /><span>回收站月嫂</span></li>
                }
            </ul>
        </div>
    </div>
    <!--主页主题部分 结束-->
    <!--主页主题部分 结束-->
    <!--侧栏导航-->
    <ul class="sidebar">
        <li><a href="/">
            <img src="~/Themes/default/home/images/btn_06.png" /><span>主页</span></a></li>
        @* @if (Html.LoadModulePowers(@Model, "Customer"))
        {
            <li><a href="/Home/Main/Customer/">
                <img src="~/Themes/default/home/images/home_btn_03.png"/><span>客户管理</span></a></li>
        }*@
      @*  @if (Html.LoadModulePowers(@Model, "Order_add"))
        {
            <li><a href="/Order/Order/OrderAdd/">
                <img src="~/Themes/default/home/images/order_01.png"><span>新增订单</span></a></li>
        }*@
        @if (Html.LoadModulePowers(@Model, "Order"))
        {
            <li><a href="/Home/Main/Order/">
                <img src="~/Themes/default/home/images/home_btn_05.png" /><span>订单管理</span></a></li> 
        }
        @if (Html.LoadModulePowers(@Model, "Yuangong"))
        {
            <li><a href="/Home/Main/Yuangong/">
                <img src="~/Themes/default/home/images/home_btn_07.png" /><span>员工管理</span></a></li>
        }
        @if (Html.LoadModulePowers(@Model, "Finance"))
        {
            <li><a href="/Home/Main/Finance/">
                <img src="~/Themes/default/home/images/home_btn_09.png" /><span>财务信息</span></a></li> 
        }
        @if (Html.LoadModulePowers(@Model, "Settings"))
        {
            <li><a href="/Home/Main/Seting/">
                <img src="~/Themes/default/home/images/home_btn_11.png" /><span>系统设置</span></a></li>
        }
    </ul>
</body>
</html>
